package com.sloan.community.repository;

import com.sloan.community.po.ArticleTag;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;

@Repository
public interface ArticleTagRepository extends R2dbcRepository<ArticleTag, Long> {

    Flux<ArticleTag> findByArticleId(Long articleId);

    // 这样写竟然可以
    Flux<ArticleTag> findByArticleIdIsIn(List<Long> articleIds);

    Mono<Void> deleteByArticleId(Long articleId);

    Flux<ArticleTag> findByTagId(Long tagId);
}
